package com.service.impl;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.mail.SimpleMailMessage;
import org.springframework.mail.javamail.JavaMailSender;
import org.springframework.stereotype.Service;

@Service
public class MailService {

    @Autowired
    private JavaMailSender mailSender;



    public void sendSimpleMail(String to, String subject, String content) {
        // 创建简单邮件消息对象
        SimpleMailMessage message = new SimpleMailMessage();
        message.setFrom("@qq.com");
        message.setTo(to);
        message.setSubject(subject);
        message.setText(content);

        // 发送邮件
        mailSender.send(message);
    }
}
